package com.onecar.carplatform.common.protocol.jt808;

import com.onecar.carplatform.common.constants.Jt808MsgId;
import com.onecar.carplatform.common.protocol.annotations.JtMsgDesc;
import com.onecar.carplatform.common.protocol.basics.JtMessage;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.util.ReferenceCountUtil;
import lombok.Data;
import lombok.ToString;

@Data
@ToString(callSuper = true)
@JtMsgDesc(msgId = Jt808MsgId.PLATFORM_GENERAL_RESPONSE)
public class Jt808Msg8001 extends JtMessage {

    private int replySerialNumber;
    private int replyId;
    private int result;

    @Override
    public byte[] encodeMsgBody() {
        ByteBuf msgBody = ByteBufAllocator.DEFAULT.heapBuffer(5);
        msgBody.writeShort(replySerialNumber);
        msgBody.writeShort(replyId);
        msgBody.writeByte(result);
        byte[] msgBodyArr = msgBody.array();
        ReferenceCountUtil.release(msgBody);
        return msgBodyArr;
    }

    @Override
    public void decodeMsgBody(ByteBuf buf) {
    }

}
